import { useLoginStore } from '@/store/login';
import { storeToRefs } from 'pinia';

function usePermissions(permissionsName: string) {
  const loginStore = useLoginStore();
  const { statePermissions } = storeToRefs(loginStore);
  return Boolean(statePermissions.value?.find((item) => item.includes(permissionsName)));
}

export default usePermissions;
